<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  
  <title>Jetson安装Mysql | 花椒茴香的博客</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta name="description" content="如何使用JetsonNano或者树莓派搭建自己的服务器？nano介绍Jetson Nano和树莓派的区别Jetson Nano 是一款功能强大的小型计算机，专为支持入门级边缘 AI 应用程序和设备而设计，拥有完善的 NVIDIA JetPack™ SDK 包含用于深度学习、计算机视觉、图形、多媒体等方面的加速库。 相比于树莓派多了显卡，也就是你可以通过图形化界面去操作，不只是命令行，在图像处理方面">
<meta property="og:type" content="article">
<meta property="og:title" content="Jetson安装Mysql">
<meta property="og:url" content="http://huajiaohuixiang.gitee.io/2021/10/25/Jetson%E5%AE%89%E8%A3%85Mysql/index.html">
<meta property="og:site_name" content="花椒茴香的博客">
<meta property="og:description" content="如何使用JetsonNano或者树莓派搭建自己的服务器？nano介绍Jetson Nano和树莓派的区别Jetson Nano 是一款功能强大的小型计算机，专为支持入门级边缘 AI 应用程序和设备而设计，拥有完善的 NVIDIA JetPack™ SDK 包含用于深度学习、计算机视觉、图形、多媒体等方面的加速库。 相比于树莓派多了显卡，也就是你可以通过图形化界面去操作，不只是命令行，在图像处理方面">
<meta property="og:locale" content="en_US">
<meta property="article:published_time" content="2021-10-25T07:11:31.000Z">
<meta property="article:modified_time" content="2021-11-24T14:51:47.206Z">
<meta property="article:author" content="John Doe">
<meta property="article:tag" content="服务器">
<meta property="article:tag" content="JetsonNano">
<meta name="twitter:card" content="summary">
  
    <link rel="alternate" href="/atom.xml" title="花椒茴香的博客" type="application/atom+xml">
  
  
    <link rel="shortcut icon" href="/favicon.png">
  
  
    
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/typeface-source-code-pro@0.0.71/index.min.css">

  
  
<link rel="stylesheet" href="/css/style.css">

  
    
<link rel="stylesheet" href="/fancybox/jquery.fancybox.min.css">

  
<meta name="generator" content="Hexo 5.4.0"></head>

<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">花椒茴香的博客</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/">Home</a>
        
          <a class="main-nav-link" href="/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="Search"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="http://huajiaohuixiang.gitee.io"></form>
      </div>
    </div>
  </div>
</header>

      <div class="outer">
        <section id="main"><article id="post-Jetson安装Mysql" class="h-entry article article-type-post" itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
  <div class="article-meta">
    <a href="/2021/10/25/Jetson%E5%AE%89%E8%A3%85Mysql/" class="article-date">
  <time class="dt-published" datetime="2021-10-25T07:11:31.000Z" itemprop="datePublished">2021-10-25</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="p-name article-title" itemprop="headline name">
      Jetson安装Mysql
    </h1>
  

      </header>
    
    <div class="e-content article-entry" itemprop="articleBody">
      
        <h1 id="如何使用JetsonNano或者树莓派搭建自己的服务器？"><a href="#如何使用JetsonNano或者树莓派搭建自己的服务器？" class="headerlink" title="如何使用JetsonNano或者树莓派搭建自己的服务器？"></a>如何使用JetsonNano或者树莓派搭建自己的服务器？</h1><h3 id="nano介绍"><a href="#nano介绍" class="headerlink" title="nano介绍"></a>nano介绍</h3><h4 id="Jetson-Nano和树莓派的区别"><a href="#Jetson-Nano和树莓派的区别" class="headerlink" title="Jetson Nano和树莓派的区别"></a>Jetson Nano和树莓派的区别</h4><p>Jetson Nano 是一款功能强大的小型计算机，专为支持入门级边缘 AI 应用程序和设备而设计，拥有完善的 NVIDIA JetPack™ SDK 包含用于深度学习、计算机视觉、图形、多媒体等方面的加速库。 相比于树莓派多了显卡，也就是你可以通过图形化界面去操作，不只是命令行，在图像处理方面很强。</p>
<h4 id="系统"><a href="#系统" class="headerlink" title="系统"></a>系统</h4><p>Jetson nano 官方系统是ubuntu，是在ubuntu上修改的NVIDIA系统 ubuntu18.04 LTS，好像是是aarch架构，系统界面如下</p>
<h3 id="安装配置mysql"><a href="#安装配置mysql" class="headerlink" title="安装配置mysql"></a>安装配置mysql</h3><h4 id="安装"><a href="#安装" class="headerlink" title="安装"></a>安装</h4><p>和直接在ubuntu上安装没有什么区别，直接使用apt-get install mysql-server 得到的是5.x版本，不是最新的8.x版本 使用 apt-get 安装完后 会生成一些默认的账户在 /etc/mysql/debian.cnf中 可以通过sudo cat /etc/mysql/debian.cnf查看</p>
<h4 id="配置用户"><a href="#配置用户" class="headerlink" title="配置用户"></a>配置用户</h4><p>登录应该是需要安装mysqsl-client,也是使用apt-get install mysql-client安装</p>
<p>然后登录</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">mysql -u username -p </span><br></pre></td></tr></table></figure>

<p>然后输入密码</p>
<p>新建用户，赋予权限</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">create user &#x27;username&#x27;@&#x27;localhost&#x27; identified by &#x27;password&#x27;;</span><br><span class="line">#username是你想创建的用户名</span><br><span class="line">#localhost是表示它可以通过那个ip来访问，localhost表示本地 其余ip表示其他地址 %表示所有</span><br><span class="line">#password是密码</span><br><span class="line">grant all privileges on 数据库.* to username@ip地址 ;</span><br><span class="line">#好像mysql的用户是通过 username+ip来区别，可以有连个username相同的用户，只要ip不一样。</span><br></pre></td></tr></table></figure>

<h4 id="修改配置文件，实现远程访问"><a href="#修改配置文件，实现远程访问" class="headerlink" title="修改配置文件，实现远程访问"></a>修改配置文件，实现远程访问</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">cd /etc/mysql</span><br><span class="line"></span><br><span class="line">//然后ls一下 我的有下面这些东西，配置文件在mysql.conf.d中</span><br><span class="line">//conf.d      debian-start  my.cnf.fallback  mysql.conf.d</span><br><span class="line">//debian.cnf  my.cnf        mysql.cnf</span><br><span class="line"></span><br><span class="line">cd mysql.conf.d</span><br><span class="line">vim mysqld.cnf</span><br><span class="line">     //将地址127.0.0.1 改成0.0.0.0</span><br><span class="line">service mysql restart</span><br></pre></td></tr></table></figure>

<h4 id="mysql其他常用命令："><a href="#mysql其他常用命令：" class="headerlink" title="mysql其他常用命令："></a>mysql其他常用命令：</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">sudo service mysql restart</span><br><span class="line">sudo netstat -tap | grep mysql        #查看是否允许</span><br></pre></td></tr></table></figure>

<h3 id="配置内网穿透"><a href="#配置内网穿透" class="headerlink" title="配置内网穿透"></a>配置内网穿透</h3><p>我选择使用花生壳进行内网穿透，花生壳还是比较方便的。</p>
<p>应该是可以直接参考树莓派的官方教程<a target="_blank" rel="noopener" href="https://service.oray.com/question/11639.html">https://service.oray.com/question/11639.html</a></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">dpkg -i phtunnel_5_0_rapi_aarch64.deb      #安装</span><br></pre></td></tr></table></figure>

<p>可以通过以下命令来操作：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">phddns           	#查看命令</span><br><span class="line">phddns 	start		#打开</span><br><span class="line">phddns status		#可以查看SN码</span><br></pre></td></tr></table></figure>

<p>打开<a target="_blank" rel="noopener" href="http://b.oray.com/">http://b.oray.com</a> ，在登录页面中输入SN码与默认密码（admin）登录。</p>
<p>剩下的就看官方教程就好了<a target="_blank" rel="noopener" href="https://service.oray.com/question/11639.html">https://service.oray.com/question/11639.html</a></p>
<p>建立的映射应该是tcp类型，绑定到3306端口</p>
<p><strong>注意，需要先给你的Nano 配置IP与MAC绑定，因为你的路由器应该是使用动态分配IP，打开192.168.1.1即可进行绑定，不然每次都要重新 在管理界面绑定一次</strong>。</p>
<h3 id="测试"><a href="#测试" class="headerlink" title="测试"></a>测试</h3><p>可以先在内网测试一下能否脸上nano的mysql，使用ifconfig获得内网地址类似与192.168.1.101，然后在自己电脑上用workbench测试一下。</p>
<p>测试成功后绑定外网然后在外网试一下。</p>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://huajiaohuixiang.gitee.io/2021/10/25/Jetson%E5%AE%89%E8%A3%85Mysql/" data-id="ckvf4x3ms0000okv1h7ji03x8" data-title="Jetson安装Mysql" class="article-share-link">Share</a>
      
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/JetsonNano/" rel="tag">JetsonNano</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E6%9C%8D%E5%8A%A1%E5%99%A8/" rel="tag">服务器</a></li></ul>

    </footer>
  </div>
  
    
<nav id="article-nav">
  
    <a href="/2021/10/25/%E6%95%A3%E8%90%BD%E7%9A%84%E8%AE%B0%E5%BD%95/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Newer</strong>
      <div class="article-nav-title">
        
          散落的记录
        
      </div>
    </a>
  
  
    <a href="/2021/10/25/%E5%86%85%E7%BD%91%E7%A9%BF%E9%80%8F/" id="article-nav-older" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Older</strong>
      <div class="article-nav-title">内网穿透</div>
    </a>
  
</nav>

  
</article>


</section>
        
          <aside id="sidebar">
  
    

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tags</h3>
    <div class="widget">
      <ul class="tag-list" itemprop="keywords"><li class="tag-list-item"><a class="tag-list-link" href="/tags/JetsonNano/" rel="tag">JetsonNano</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Kinect/" rel="tag">Kinect</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/frp/" rel="tag">frp</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/hexo/" rel="tag">hexo</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/linux/" rel="tag">linux</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/mysql/" rel="tag">mysql</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/redis/" rel="tag">redis</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/windows/" rel="tag">windows</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA/" rel="tag">博客搭建</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E6%9C%8D%E5%8A%A1%E5%99%A8/" rel="tag">服务器</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E7%BD%91%E7%BB%9C/" rel="tag">网络</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E8%AF%BB%E4%B9%A6%E7%AC%94%E8%AE%B0/" rel="tag">读书笔记</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tag Cloud</h3>
    <div class="widget tagcloud">
      <a href="/tags/JetsonNano/" style="font-size: 10px;">JetsonNano</a> <a href="/tags/Kinect/" style="font-size: 10px;">Kinect</a> <a href="/tags/frp/" style="font-size: 10px;">frp</a> <a href="/tags/hexo/" style="font-size: 10px;">hexo</a> <a href="/tags/linux/" style="font-size: 10px;">linux</a> <a href="/tags/mysql/" style="font-size: 10px;">mysql</a> <a href="/tags/redis/" style="font-size: 10px;">redis</a> <a href="/tags/windows/" style="font-size: 10px;">windows</a> <a href="/tags/%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA/" style="font-size: 10px;">博客搭建</a> <a href="/tags/%E6%9C%8D%E5%8A%A1%E5%99%A8/" style="font-size: 15px;">服务器</a> <a href="/tags/%E7%BD%91%E7%BB%9C/" style="font-size: 10px;">网络</a> <a href="/tags/%E8%AF%BB%E4%B9%A6%E7%AC%94%E8%AE%B0/" style="font-size: 20px;">读书笔记</a>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archives</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2021/12/">December 2021</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2021/11/">November 2021</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2021/10/">October 2021</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Recent Posts</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2021/12/08/%E5%BC%A0%E7%BE%8E%E4%B8%BD/">张美丽</a>
          </li>
        
          <li>
            <a href="/2021/12/08/%E9%9D%92%E9%9D%92/">青青</a>
          </li>
        
          <li>
            <a href="/2021/12/08/%E5%B0%8F%E5%BC%A0%E5%92%8C%E5%B0%8F%E4%B8%BD/">小张和小丽</a>
          </li>
        
          <li>
            <a href="/2021/11/24/%E5%91%90%E5%96%8A/">呐喊</a>
          </li>
        
          <li>
            <a href="/2021/11/24/%E9%87%8E%E8%8D%89/">野草</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      
      &copy; 2021 John Doe<br>
      Powered by <a href="https://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>

    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">Home</a>
  
    <a href="/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    


<script src="/js/jquery-3.4.1.min.js"></script>



  
<script src="/fancybox/jquery.fancybox.min.js"></script>




<script src="/js/script.js"></script>





  </div>
</body>
</html>